import 'package:app/services/address.dart';
import 'package:get/get.dart';

import '../../services/dio_manager.dart';
import 'milepost_model.dart';

class MilepostController extends GetxController{



  MilePostModel? model;

  requestData(var project_id)async{

    var params = {
      'page':'1',
      'limit':'1000',
      'search':'',
      'project_id':project_id,
    };
    var json = await DioManager().kkRequest(Address.milepostPage,params: params,method: 'get');

    MilePostModel _model = MilePostModel.fromJson(json);

    model = _model;

    update();
  }

  onRefresh()async{
    requestData(Get.arguments);
  }



  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();
    requestData(Get.arguments);
  }
}